﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="List.aspx.cs" Inherits="HQWeb.SysManage.UniualMateral.List" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../../Styles/GridViewStyle.css" rel="Stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div>
            <div>
                <asp:Button ID="btnAdd" runat="server" Text="添 加" OnClick="btnAdd_Click" /></div>
            <hr />
            <div>
                <asp:GridView ID="GridView1" CssClass="GridViewStyle" runat="server" AutoGenerateColumns="False"
                    PageSize="10" Width="100%" AllowPaging="True" CellPadding="4" EmptyDataText="没有数据记录！！"
                    OnPageIndexChanging="GridView1_PageIndexChanging" GridLines="None" DataKeyNames="id"
                    OnRowCommand="GridView1_RowCommand">
                    <Columns>
                        <asp:TemplateField HeaderText="序号" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <%#Container.DisplayIndex +1%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="MATERIAL_NAME" HeaderText="物品名称" ItemStyle-Width="20%"
                            ItemStyle-HorizontalAlign="Center">
                            <ItemStyle Width="20%"></ItemStyle>
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="月份" ItemStyle-Width="10%">
                            <ItemTemplate>
                                <%#Eval("month").ToString()+"月份" %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="NAME" HeaderText="预 算" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Center">
                        </asp:BoundField>
                        <asp:TemplateField ControlStyle-Width="96px" HeaderText="照片" ItemStyle-Height="54px" ItemStyle-Width="96px">
                            <ItemTemplate>
                                <asp:Image ID="Image1" runat="server" ImageUrl='<%#Eval("IMAGEURL")==DBNull.Value? "../Images/Element/nophoto.bmp":Eval("ImageUrl")%>'
                                    Width="96px" Height="54px" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="推荐理由">
                            <ItemTemplate>
                                <a title='<%#Eval("other")%>'>
                                    <%#Eval("other").ToString().Length > 50 ? Eval("other").ToString().Substring(0, 45) + "..." : Eval("other").ToString()%></a>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="操作" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%">
                            <ItemTemplate>
                                <asp:LinkButton ID="btnEdit" runat="server" Text="编 辑" CommandName="UpdateData" CommandArgument='<%#Eval("id")%>'></asp:LinkButton>
                                <asp:LinkButton ID="btnDelete" runat="server" Text="删 除" CommandName="DelData" CommandArgument='<%#Eval("id")%>'
                                    OnClientClick=" return confirm('确定删除？')"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <PagerTemplate>
                        <table width="100%">
                            <tr>
                                <td style="text-align: center">
                                    第<asp:Label ID="lblPageIndex" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageIndex + 1  %>' />页
                                    共<asp:Label ID="lblPageCount" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageCount  %>' />页
                                    <asp:LinkButton ID="btnFirst" runat="server" CausesValidation="False" CommandArgument="First"
                                        CommandName="Page" Text="首页" />
                                    <asp:LinkButton ID="btnPrev" runat="server" CausesValidation="False" CommandArgument="Prev"
                                        CommandName="Page" Text="上一页" />
                                    <asp:LinkButton ID="btnNext" runat="server" CausesValidation="False" CommandArgument="Next"
                                        CommandName="Page" Text="下一页" />
                                    <asp:LinkButton ID="btnLast" runat="server" CausesValidation="False" CommandArgument="Last"
                                        CommandName="Page" Text="尾页" />
                                    <asp:TextBox ID="txtNewPageIndex" runat="server" Width="28px" Text='<%# ((GridView)Container.Parent.Parent).PageIndex + 1  %>' />
                                    <asp:LinkButton ID="btnGo" runat="server" CausesValidation="False" CommandArgument="-1"
                                        CommandName="Page" Text="GO" /><!-- here set the CommandArgument of the Go Button to '-1' as the flag -->
                                </td>
                            </tr>
                        </table>
                    </PagerTemplate>
                    <FooterStyle CssClass="GridViewFooterStyle" />
                    <RowStyle CssClass="GridViewRowStyle" />
                    <SelectedRowStyle CssClass="GridViewSelectedRowStyle" />
                    <PagerStyle CssClass="GridViewPagerStyle" />
                    <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                    <HeaderStyle CssClass="GridViewHeaderStyle" />
                </asp:GridView>
            </div>
            <%--  </td>
            </tr>
        </table>--%>
        </div>
        <div style="display: none">
            <asp:TextBox ID="HidMonth" runat="server" Style="visibility: hidden"></asp:TextBox>
            <asp:TextBox ID="hidPrice" runat="server" Style="visibility: hidden"></asp:TextBox>
        </div>
    </div>
    </form>
</body>
</html>
